package com.imut.lagain.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.persistence.Column;
import jakarta.persistence.PreUpdate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.LocalDateTime;

/**
 * 焦虑安抚会话实体类
 */
@TableName("anxiety_session")
public class AnxietySession {
    private static final Logger log = LoggerFactory.getLogger(AnxietySession.class);


    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("session_id")
    private String sessionId;

    @TableField("user_id")
    private Long userId;

    @TableField("initial_anxiety_level")
    private Integer initialAnxietyLevel;

    @TableField("final_anxiety_level")
    private Integer finalAnxietyLevel;

    @TableField("triggers")
    private String triggers;

    @TableField("start_time")
    private LocalDateTime startTime;

    @TableField("end_time")
    private LocalDateTime endTime;

    @TableField("status")
    private String status; // active, completed, abandoned

    @TableField("breathing_cycles")
    private Integer breathingCycles;

    @TableField("breathing_effectiveness")
    private Integer breathingEffectiveness;

    @TableField("sensory_data")
    private String sensoryData;

    @TableField("thought_analysis_count")
    private Integer thoughtAnalysisCount;

    @TableField("techniques_used")
    private String techniquesUsed;

    @TableField("feedback")
    private String feedback;

    @TableField("created_at")
    private LocalDateTime createdAt;

    @Column(name = "updated_at")
    private LocalDateTime updatedAt;

    @Column(name = "is_deleted")
    private Boolean isDeleted = false;
    public AnxietySession() {
        this.createdAt = LocalDateTime.now();
        this.updatedAt = LocalDateTime.now();
    }
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getInitialAnxietyLevel() {
        return initialAnxietyLevel;
    }

    public void setInitialAnxietyLevel(Integer initialAnxietyLevel) {
        this.initialAnxietyLevel = initialAnxietyLevel;
    }

    public Integer getFinalAnxietyLevel() {
        return finalAnxietyLevel;
    }

    public void setFinalAnxietyLevel(Integer finalAnxietyLevel) {
        this.finalAnxietyLevel = finalAnxietyLevel;
    }

    public String getTriggers() {
        return triggers;
    }

    public void setTriggers(String triggers) {
        this.triggers = triggers;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Integer getBreathingCycles() {
        return breathingCycles;
    }

    public void setBreathingCycles(Integer breathingCycles) {
        this.breathingCycles = breathingCycles;
    }

    public Integer getBreathingEffectiveness() {
        return breathingEffectiveness;
    }

    public void setBreathingEffectiveness(Integer breathingEffectiveness) {
        this.breathingEffectiveness = breathingEffectiveness;
    }

    public String getSensoryData() {
        return sensoryData;
    }

    public void setSensoryData(String sensoryData) {
        this.sensoryData = sensoryData;
    }

    public Integer getThoughtAnalysisCount() {
        return thoughtAnalysisCount;
    }

    public void setThoughtAnalysisCount(Integer thoughtAnalysisCount) {
        this.thoughtAnalysisCount = thoughtAnalysisCount;
    }

    public String getTechniquesUsed() {
        return techniquesUsed;
    }

    public void setTechniquesUsed(String techniquesUsed) {
        this.techniquesUsed = techniquesUsed;
    }

    public String getFeedback() {
        return feedback;
    }

    public void setFeedback(String feedback) {
        this.feedback = feedback;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Boolean getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    @PreUpdate
    public void preUpdate() {
        this.updatedAt = LocalDateTime.now();
    }
}
